#pragma once
#include <Rz/Object.h>
#include "Size.h"

namespace Rz { namespace Graphics { namespace Math {

class Rectangle :
	public Object
{
	public:
		RZ_RTTI(Rz::Graphics::Math, Rectangle);
		RZ_RTTI_IMPLEMENTS(Object);
		RZ_RTTI_END;

		RZ_INLINE Rectangle()
			: Rectangle(0, 0, 0, 0)
		{

		}

		RZ_INLINE Rectangle(const Size& position, const Size& size)
			: _x(position.GetWidth())
			, _y(position.GetHeight())
			, _width(size.GetWidth())
			, _height(size.GetHeight())
		{

		}

		RZ_INLINE Rectangle(size_t x, size_t y, size_t width, size_t height)
			: _x(x)
			, _y(y)
			, _width(width)
			, _height(height)
		{

		}

		RZ_INLINE size_t GetX() const { return _x; }
		RZ_INLINE size_t GetY() const { return _y; }
		RZ_INLINE size_t GetWidth() const { return _width; }
		RZ_INLINE size_t GetHeight() const { return _height; }
		RZ_INLINE Size GetSize() const { return Size(_width, _height); }

		RZ_INLINE void SetX(size_t x) { _x = x; }
		RZ_INLINE void SetY(size_t y) { _y = y; }
		RZ_INLINE void SetWidth(size_t width) { _width = width; }
		RZ_INLINE void SetHeight(size_t height) { _height = height; }
		RZ_INLINE void SetSize(const Size& size) { _width = size.GetWidth(); _height = size.GetHeight(); }

		RZ_INLINE void Set(size_t v[4]) { _x = v[0]; _y = v[1], _width = v[2], _height = v[3]; }

	private:
		size_t _x, _y;
		size_t _width, _height;
};

} } }
